package com.lsc.record.core.service;

import java.util.List;
import java.util.Map;

import org.springframework.web.multipart.MultipartFile;

import com.alibaba.fastjson2.JSONArray;
import com.lsc.record.controller.parameter.PageInfo;
import com.lsc.record.core.entity.DmContent;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.row.Row;

public interface DocumentServcie {
	/**
	 * 分页查询
	 * @param pageInfo
	 * @param typeName
	 * @param parameters
	 * @return
	 */
	public Page<Row> queryPage(PageInfo pageInfo,String typeName,JSONArray parameters);

	/**
	 * 创建文档
	 * @param typeName
	 * @param data
	 * @return
	 * @throws Exception
	 */
	public Row create(String typeName, Map<String, Object> data) throws Exception;
	
	/**
	 * 创建文档
	 * @param typeName
	 * @param data
	 * @return
	 * @throws Exception
	 */
	public Row create(String typeName, Map<String, Object> data,MultipartFile file) throws Exception;

	/**
	 * 获取文档当前文件信息
	 * @param docId
	 * @return
	 * @throws Exception
	 */
	public DmContent getCurrentContent(String docId) throws Exception;

	/**
	 * 获取文档历史版本列表
	 * @param docId
	 * @return
	 * @throws Exception
	 */
	public List<DmContent> getContentVersionList(String docId) throws Exception;

	public Row getDocument(String id) throws Exception;

	public Boolean update(Map<String, Object> data) throws Exception;
}
